package com.fenyin.samples.study.jvm.memory;  

import java.util.ArrayList;
import java.util.List;

/**
 * VM args:-Xms20M -Xmx20M -XX:+HeapDumpOnOutOfMemoryError
 *@Title:  
 *@Description:  java堆内存溢出例子
 *@Author:fengzhichao  
 *@Since:2012-8-24  
 *@Version:1.1.0
 */
public class HeapMemoryError {
	
	/**
	 *@Title:  
	 *@Description: 内存对象，申请分配内存 
	 *@Author:fengzhichao  
	 *@Since:2012-8-25  
	 *@Version:1.1.0
	 */
	public static class MemoryObject{
		
	}
	
	public static void main(String[] args){
		List<MemoryObject> list = new ArrayList<MemoryObject>();
		while(true){
			list.add(new MemoryObject());
		}
	}
	
}
